<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>异步加载的script特殊引入</title>
</head>

<body>
  <div>我是页面</div>

  <script>
    console.log(111)
    const script = document.createElement('script');
    script.src = 'test.js';
    document.head.appendChild(script);
    script.onload = () => {
      // test.js 作用域
      console.log(222)
      test();
      console.log('@testA', testA);
    }
  </script>
</body>

</html>